package cn.lyjuan.android.demofive.frame.tpl.demo;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import cn.lyjuan.android.demofive.R;
import cn.lyjuan.android.mylibrary.context.RealmApplication;
import cn.lyjuan.android.mylibrary.frame.load.IFragmentLoad;
import cn.lyjuan.android.mylibrary.frame.load.impl.NetLoadImpl;
import io.realm.Realm;

/**
 * Created by chad on 13/11/2017.
 */
public class TplRecyclerActivity extends AppCompatActivity
{
    private Realm realm;

    /**
     * 根据网络状态选择不同fragment功能
     */
    private IFragmentLoad netLoad;

    private int layoutId = R.layout.frame_tpl_activity;

    private int fragmentContainerId = R.id.tpl_framelayout;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        setContentView(layoutId);

        realm = RealmApplication.realm();

        Fragment normal = new RecyclerFragment();

        netLoad = new NetLoadImpl(this, normal, fragmentContainerId);

        netLoad.inflate();
    }
}
